/*
 * 
 *  This file is part of Sourceprojects.org Lycia Copyright 2010 noctarius
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 * 
 */
package org.sourceprojects.lycia.internal.platform.android;

public enum AndroidApiVersion {
	IllegalPlatform(-1),

	Base1_0(1), Base1_1(2), Cupcake1_5(3), Donut1_6(4), Eclair2_0(5), Eclair2_0_1(
			6), Eclair2_1(7), Froyo_2_2(8), Gingerbread_2_3(9), Gingerbread_2_3_3(
			10), Honeycomb_3_0(11),

	DevBuild(10000);

	private final int apiLevel;

	private AndroidApiVersion(final int apiLevel) {
		this.apiLevel = apiLevel;
	}

	public int getApiLevel() {
		return apiLevel;
	}

	public static final AndroidApiVersion getByApiLevel(final int value) {
		for (final AndroidApiVersion v : AndroidApiVersion.values()) {
			if (v.getApiLevel() == value) {
				return v;
			}
		}

		return AndroidApiVersion.IllegalPlatform;
	}

}
